package com.ruoyi.refundInfo.domain;

import java.math.BigDecimal;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;

/**
 * 退款信息日志管理对象 wdmf_refund_info
 * 
 * @author ruoyi
 * @date 2025-08-02
 */
@Data
public class RefundInfo extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 退款ID（主键） */
    private Long refundId;

    /** 关联支付ID（wdmf_payment_info.payment_id） */
    @Excel(name = "关联支付ID", readConverterExp = "w=dmf_payment_info.payment_id")
    private Long paymentId;

    /** 关联订单ID（wdmf_order_detail.order_id） */
    @Excel(name = "关联订单ID", readConverterExp = "w=dmf_order_detail.order_id")
    private Long orderId;

    /** 退款金额（≤wdmf_payment_info.refundable_amt） */
    @Excel(name = "退款金额", readConverterExp = "≤=wdmf_payment_info.refundable_amt")
    private BigDecimal refundAmt;

    /** 退款状态：0=待退款 1=申请退款 2=退款中 3=已退款 4=退款失败 */
    @Excel(name = "退款状态", readConverterExp = "0=待退款 1=申请退款 2=退款中 3=已退款 4=退款失败")
    private String refundStatus;

    /** 退款原因（如“用户重复支付”） */
    @Excel(name = "退款原因", readConverterExp = "如=“用户重复支付”")
    private String refundReason;

    /** 微信退款交易单号（微信支付回调返回） */
    @Excel(name = "微信退款交易单号", readConverterExp = "微=信支付回调返回")
    private String refundTransId;

    /** 退款成功时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "退款成功时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date refundTime;

    /** 状态（0=上架 1=下架） */
    @Excel(name = "状态", readConverterExp = "0==上架,1==下架")
    private String status;

    /** 删除标志（0存在 2删除） */
    private String delFlag;

    /** 版本号（乐观锁） */
    @Excel(name = "版本号", readConverterExp = "乐观锁")
    private Long version;

    /** 退款码 */
    private String refundCode;

    /** 退款码描述 */
    @Excel(name = "退款码描述", readConverterExp = "0==商家取消订单,1==其他")
    private String reason;

    /** 退款审核状态（0=待审核 1=审核通过 2=审核拒绝） */
    @Excel(name = "退款审核状态", readConverterExp = "0=待审核 1=审核通过 2=审核拒绝")
    private String refundAuditStatus;

    /** 退款申请审核人 */
    private String auditBy;

    /** 退款申请审核时间 */
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @Excel(name = "退款申请审核时间", width = 30, dateFormat = "yyyy-MM-dd HH:mm:ss")
    private Date auditTime;

    /** 退款申请审核备注 */
    private String auditRemark;

    private Long goodsOrderId;


    @Override
    public String toString() {
        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
            .append("refundId", getRefundId())
            .append("paymentId", getPaymentId())
            .append("orderId", getOrderId())
            .append("refundAmt", getRefundAmt())
            .append("refundStatus", getRefundStatus())
            .append("refundReason", getRefundReason())
            .append("refundTransId", getRefundTransId())
            .append("refundTime", getRefundTime())
            .append("status", getStatus())
            .append("delFlag", getDelFlag())
            .append("version", getVersion())
            .append("createTime", getCreateTime())
            .append("updateTime", getUpdateTime())
            .append("createBy", getCreateBy())
            .append("updateBy", getUpdateBy())
            .append("remark", getRemark())
            .append("refundCode", getRefundCode())
            .append("reason", getReason())
            .append("refundAuditStatus", getRefundAuditStatus())
            .append("auditBy", getAuditBy())
            .append("auditTime", getAuditTime())
            .append("auditRemark", getAuditRemark())
            .append("goodsOrderId", getGoodsOrderId())
            .toString();
    }

}
